<?php
include ('global.php');

$do_str = trim($_GET['do']);

if (strpos($do_str, '.') !== false) {
	$do_str_arr = explode('.', $do_str);
	$class_subdir = strtolower($do_str_arr[0]);
	$class_name = ucwords($do_str_arr[0] . '_' . ucwords($do_str_arr[1])) . 'Controller';
} else {
	$class_subdir = 'front';
	$class_name = 'Front_' . ucwords($do_str) . 'Controller';
}
if (file_exists(CLASS_PATH . $class_subdir . DS . $class_name . '.class.php') && is_file(CLASS_PATH . $class_subdir . DS . $class_name . '.class.php')) {
	include (CLASS_PATH . $class_subdir . DS . $class_name . '.class.php');
	$obj = &new $class_name();
	$obj->dispatcher();
} else {
	die('Invalid Request!');
}